package com.founder.sample;

import com.founder.entity.Order;
import com.founder.tool.xml.Xml2Entity;

public class XmlToObject {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String xml = "<entity type=\"Order\">" +
						"<entityItem name=\"date\">2012-02-01 00:00:00</entityItem>" +
						"<entityItem name=\"name\">中国</entityItem>" +
						"<entityItem name=\"orderId\">10</entityItem>" +
					 "</entity>";
    	//XML转对象
    	Xml2Entity x2e = new Xml2Entity(xml);
    	Order order = (Order)x2e.getResult();
		
		System.out.println("======order======");
		System.out.println("Name:" + order.getName());
		System.out.println("OrderId:" + order.getOrderId());
	}

}
